home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
221_01
/
cc2.asm
< prev
next >
Wrap
Assembly Source File
|
1980-01-01
|
22KB
|
1,905 lines
;small-c V2.3
EXT ccdiv,ccmult
EXT fopen,fclose,getc,putc,putchar,getchar,rewind,gets
EXT exit
EXT CCSWITCH
EXT CCPOLL
EXT isalpha,isupper,islower,isdigit,isspace
EXT toupper,tolower
EXT strlen,reverse,left,strcmp,strcpy
EXT abs,itoa,atoi,printf
EXT addglb
EXT addloc
EXT addwhile
EXT amatch
EXT blanks
EXT ch
EXT comment
EXT constexp
EXT cout
EXT debug
EXT declloc
EXT defname
EXT defstora
EXT delwhile
EXT doexpres
EXT dumplits
EXT endst
EXT entry
EXT errrpt
EXT findglb
EXT findloc
EXT gch
EXT getlabel
EXT getint
EXT illname
EXT inbyte
EXT inchar
EXT inline
EXT junk
EXT jump
EXT kill
EXT match
EXT modstk
EXT multidef
EXT needbrac
EXT nextsym
EXT nl
EXT number
EXT outbyte
EXT outdec
EXT outstr
EXT postlabe
EXT printlab
EXT putint
EXT readwhil
EXT ret
EXT sout
EXT streq
EXT sw
EXT symname
EXT tab
EXT test
EXT argstk
EXT ctext
EXT cmode
EXT DEFDEBUG
EXT declared
EXT declstat
EXT eof
EXT first_fu
EXT lastst
EXT litlab
EXT litptr
EXT lptr
EXT monitor
EXT ncmp
EXT startcom
EXT statlab
EXT stdecl
EXT stkp
EXT stlab
EXT swactive
EXT swdefaul
EXT swnext
EXT swend
EXT cptr
EXT cptr2
EXT line
EXT locptr
EXT glbptr
EXT statptr
EXT symtab
NAME needsub
GLOBAL needsub
needsub
LEAS -2,S
LDD #cc1+0
PSHS D
JSR match
LEAS 2,S
CMPD #0
LBEQ cc2
LDD #0
LEAS 2,S
RTS
cc2
LEAY 0,S
TFR Y,D
PSHS D
JSR number
LEAS 2,S
PSHS D
LDD #0
CMPD ,S++
LBNE cc3
LDD #cc1+2
PSHS D
JSR errrpt
LEAS 2,S
LEAY 0,S
TFR Y,D
PSHS D
LDD #0
PSHS D
ADDD ,S++
ADDD ,S++
PSHS D
LDD #1
STD [,S++]
cc3
LEAY 0,S
TFR Y,D
PSHS D
LDD #0
PSHS D
ADDD ,S++
ADDD ,S++
PSHS D
LDD [,S++]
PSHS D
LDD #0
CMPD ,S++
LBLE cc4
LDD #cc1+19
PSHS D
JSR errrpt
LEAS 2,S
LEAY 0,S
TFR Y,D
PSHS D
LDD #0
PSHS D
ADDD ,S++
ADDD ,S++
PSHS D
LEAY 2,S
TFR Y,D
PSHS D
LDD #0
PSHS D
ADDD ,S++
ADDD ,S++
PSHS D
LDD [,S++]
COMA
COMB
ADDD #1
STD [,S++]
cc4
LDD #cc1+41
PSHS D
JSR needbrac
LEAS 2,S
LEAY 0,S
TFR Y,D
PSHS D
LDD #0
PSHS D
ADDD ,S++
ADDD ,S++
PSHS D
LDD [,S++]
LEAS 2,S
RTS
cc1 FCB 93,0,109,117,115,116,32,98,101,32
FCB 99,111,110,115,116,97,110,116,0,110
FCB 101,103,97,116,105,118,101,32,115,105
FCB 122,101,32,105,108,108,101,103,97,108
FCB 0,93,0
GLOBAL newfunc
newfunc
LEAS -13,S
LDD monitor
CMPD #0
LBEQ cc6
LDD #13
PSHS D
LDD #2
PSHS D
JSR cout
LEAS 4,S
LDD #line
PSHS D
LDD #2
PSHS D
JSR sout
LEAS 4,S
cc6
LEAY 2,S
TFR Y,D
PSHS D
JSR symname
LEAS 2,S
PSHS D
LDD #0
CMPD ,S++
LBNE cc7
LDD #cc5+0
PSHS D
JSR errrpt
LEAS 2,S
JSR kill
LEAS 13,S
RTS
cc7
LEAY 0,S
TFR Y,D
PSHS D
LEAY 4,S
TFR Y,D
PSHS D
JSR findglb
LEAS 2,S
STD [,S++]
CMPD #0
LBEQ cc8
LDD 0,S
ADDD #9
PSHS D
LDB [,S++]
SEX
PSHS D
LDD #4
CMPD ,S++
LBEQ cc9
LEAY 2,S
TFR Y,D
PSHS D
JSR multidef
LEAS 2,S
JMP cc10
cc9
LDD 0,S
ADDD #12
PSHS D
LDB [,S++]
SEX
PSHS D
LDD #4
CMPD ,S++
LBNE cc11
LEAY 2,S
TFR Y,D
PSHS D
JSR multidef
LEAS 2,S
JMP cc12
cc11
LDD 0,S
ADDD #12
PSHS D
LDD #4
STB [,S++]
cc12
cc10
JMP cc13
cc8
LEAY 2,S
TFR Y,D
PSHS D
LDD #4
PSHS D
LDD #2
PSHS D
LDD #2
DECB
BLT *+8
ASL 1,S
ROL ,S
BRA *-7
PULS D
PSHS D
LDD #4
PSHS D
JSR addglb
LEAS 8,S
cc13
LDD #cc5+32
PSHS D
JSR match
LEAS 2,S
PSHS D
LDD #0
CMPD ,S++
LBNE cc14
LDD #cc5+34
PSHS D
JSR errrpt
LEAS 2,S
cc14
LDD first_fu
CMPD #0
LBEQ cc15
LEAY 2,S
TFR Y,D
PSHS D
JSR defname
LEAS 2,S
LDD #0
STD first_fu
cc15
LEAY 2,S
TFR Y,D
PSHS D
LDD 17,S
PSHS D
JSR entry
LEAS 4,S
LDD DEFDEBUG
CMPD #0
LBEQ cc16
LEAY 2,S
TFR Y,D
PSHS D
JSR debug
LEAS 2,S
cc16
LDD #symtab
PSHS D
LDD #512
PSHS D
LDD #14
PULS X
JSR ccmult
ADDD ,S++
ADDD #14
STD locptr
LDD #0
STD argstk
cc17
LDD #cc5+53
PSHS D
JSR match
LEAS 2,S
PSHS D
LDD #0
CMPD ,S++
LBNE cc18
LEAY 2,S
TFR Y,D
PSHS D
JSR symname
LEAS 2,S
CMPD #0
LBEQ cc19
LEAY 2,S
TFR Y,D
PSHS D
JSR findloc
LEAS 2,S
CMPD #0
LBEQ cc20
LEAY 2,S
TFR Y,D
PSHS D
JSR multidef
LEAS 2,S
JMP cc21
cc20
LEAY 2,S
TFR Y,D
PSHS D
LDD #0
PSHS D
LDD #0
PSHS D
LDD argstk
PSHS D
JSR addloc
LEAS 8,S
LDD argstk
ADDD #2
STD argstk
cc21
JMP cc22
cc19
LDD #cc5+55
PSHS D
JSR errrpt
LEAS 2,S
JSR junk
cc22
JSR blanks
LDD #line
ADDD lptr
PSHS D
LDD #cc5+77
PSHS D
JSR streq
LEAS 4,S
PSHS D
LDD #0
CMPD ,S++
LBNE cc23
LDD #cc5+79
PSHS D
JSR match
LEAS 2,S
PSHS D
LDD #0
CMPD ,S++
LBNE cc24
LDD #cc5+81
PSHS D
JSR errrpt
LEAS 2,S
cc24
cc23
JSR endst
CMPD #0
LBEQ cc25
JMP cc18
cc25
JMP cc17
cc18
LDD #0
STD stkp
LEAY 11,S
TFR Y,D
PSHS D
LDD argstk
STD [,S++]
cc26
LDD argstk
CMPD #0
LBEQ cc27
LDD #cc5+96
PSHS D
LDD #4
PSHS D
JSR amatch
LEAS 4,S
CMPD #0
LBEQ cc28
LDD 11,S
PSHS D
LDD #1
PSHS D
LDD #2
DECB
BLT *+8
ASL 1,S
ROL ,S
BRA *-7
PULS D
PSHS D
JSR getarg
LEAS 4,S
JSR ns
JMP cc29
cc28
LDD #cc5+101
PSHS D
LDD #3
PSHS D
JSR amatch
LEAS 4,S
CMPD #0
LBEQ cc30
LDD 11,S
PSHS D
LDD #2
PSHS D
LDD #2
DECB
BLT *+8
ASL 1,S
ROL ,S
BRA *-7
PULS D
PSHS D
JSR getarg
LEAS 4,S
JSR ns
JMP cc31
cc30
LDD #cc5+105
PSHS D
JSR errrpt
LEAS 2,S
JMP cc27
cc31
cc29
JMP cc26
cc27
JSR statemen
PSHS D
LDD #3
CMPD ,S++
LBEQ cc32
LDD #0
PSHS D
JSR modstk
LEAS 2,S
JSR ret
cc32
LDD #0
STD stkp
LDD #symtab
PSHS D
LDD #512
PSHS D
LDD #14
PULS X
JSR ccmult
ADDD ,S++
ADDD #14
STD locptr
LDD litptr
CMPD #0
LBEQ cc33
LDD litlab
PSHS D
JSR printlab
LEAS 2,S
LDD #1
PSHS D
JSR dumplits
LEAS 2,S
JSR getlabel
STD litlab
cc33
LEAS 13,S
RTS
cc5 FCB 105,108,108,101,103,97,108,32,102,117
FCB 110,99,116,105,111,110,32,111,114,32
FCB 100,101,99,108,97,114,97,116,105,111
FCB 110,0,40,0,109,105,115,115,105,110
FCB 103,32,111,112,101,110,32,112,97,114
FCB 101,110,0,41,0,105,108,108,101,103
FCB 97,108,32,97,114,103,117,109,101,110
FCB 116,32,110,97,109,101,0,41,0,44
FCB 0,101,120,112,101,99,116,101,100,32
FCB 99,111,109,109,97,0,99,104,97,114
FCB 0,105,110,116,0,119,114,111,110,103
FCB 32,110,117,109,98,101,114,32,97,114
FCB 103,115,0
GLOBAL getarg
getarg
LEAS -18,S
cc35
LDD #1
CMPD #0
LBEQ cc36
LDD argstk
PSHS D
LDD #0
CMPD ,S++
LBNE cc37
LEAS 18,S
RTS
cc37
LDD #cc34+0
PSHS D
JSR match
LEAS 2,S
CMPD #0
LBEQ cc38
LDD #3
STD 16,S
JMP cc39
cc38
LDD #1
STD 16,S
cc39
LEAY 14,S
TFR Y,D
PSHS D
LEAY 5,S
TFR Y,D
PSHS D
JSR symname
LEAS 2,S
STD [,S++]
PSHS D
LDD #0
CMPD ,S++
LBNE cc40
JSR illname
cc40
LDD #cc34+2
PSHS D
JSR match
LEAS 2,S
CMPD #0
LBEQ cc41
cc42
JSR inbyte
PSHS D
LDD #93
CMPD ,S++
LBEQ cc43
JSR endst
CMPD #0
LBEQ cc44
JMP cc43
cc44
JMP cc42
cc43
LDD #3
STD 16,S
cc41
LDD 14,S
CMPD #0
LBEQ cc45
LEAY 0,S
TFR Y,D
PSHS D
LEAY 5,S
TFR Y,D
PSHS D
JSR findloc
LEAS 2,S
STD [,S++]
CMPD #0
LBEQ cc46
LDD 0,S
ADDD #9
PSHS D
LDD 18,S
STB [,S++]
LDD 0,S
ADDD #10
PSHS D
LDD 22,S
STB [,S++]
LEAY 12,S
TFR Y,D
PSHS D
LDD 24,S
PSHS D
LDD 4,S
ADDD #12
PSHS D
LDB [,S++]
SEX
PSHS D
LDD 6,S
PSHS D
LDD #12
ADDD #1
ADDD ,S++
PSHS D
LDB [,S++]
SEX
PSHS D
LDD #8
DECB
BLT *+8
ASL 1,S
ROL ,S
BRA *-7
PULS D
ADDD ,S++
PULS X
PSHS D
TFR X,D
SUBD ,S++
STD [,S++]
LDD 12,S
PSHS D
LDD 2,S
ADDD #12
PSHS D
LDD #2
PSHS D
JSR putint
LEAS 6,S